home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
SETUP
/
US
/
CBUILDER
/
DATA.Z
/
DOS.H
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-13
|
27KB
|
799 lines
/* dos.h
Defines structs, unions, macros, and functions for dealing
with MSDOS and the Intel iAPX86 microprocessor family.
*/
/*
* C/C++ Run Time Library - Version 8.0
*
* Copyright (c) 1987, 1997 by Borland International
* All Rights Reserved.
*
*/
/* $Revision: 8.3 $ */
#ifndef __DOS_H
#define __DOS_H
#if !defined(___DEFS_H)
#include <_defs.h>
#endif
#ifndef __cplusplus
#if !defined(_WCHAR_T) && !defined(_WCHAR_T_DEFINED)
#define _WCHAR_T
#define _WCHAR_T_DEFINED /* For WINDOWS.H */
typedef unsigned short wchar_t;
#endif
#endif
#if !defined(RC_INVOKED)
#if defined(__STDC__)
#pragma warn -nak
#endif
#pragma pack(push, 1)
#endif /* !RC_INVOKED */
#ifdef __cplusplus
extern "C" {
#endif
#define FA_NORMAL 0x00 /* Normal file, no attributes */
#define FA_RDONLY 0x01 /* Read only attribute */
#define FA_HIDDEN 0x02 /* Hidden file */
#define FA_SYSTEM 0x04 /* System file */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
#define FA_ARCH 0x20 /* Archive */
/* MSC names for file attributes */
#define _A_NORMAL 0x00 /* Normal file, no attributes */
#define _A_RDONLY 0x01 /* Read only attribute */
#define _A_HIDDEN 0x02 /* Hidden file */
#define _A_SYSTEM 0x04 /* System file */
#define _A_VOLID 0x08 /* Volume label */
#define _A_SUBDIR 0x10 /* Directory */
#define _A_ARCH 0x20 /* Archive */
#define SEEK_CUR 1
#define SEEK_END 2
#define SEEK_SET 0
#if !defined(__STDC__)
#define environ _environ
#endif
struct dfree
{
unsigned df_avail;
unsigned df_total;
unsigned df_bsec;
unsigned df_sclus;
};
struct diskfree_t
{
unsigned total_clusters;
unsigned avail_clusters;
unsigned sectors_per_cluster;
unsigned bytes_per_sector;
};
struct time
{
unsigned char ti_min; /* Minutes */
unsigned char ti_hour; /* Hours */
unsigned char ti_hund; /* Hundredths of seconds */
unsigned char ti_sec; /* Seconds */
};
struct dostime_t
{
unsigned char hour; /* Hours */
unsigned char minute; /* Minutes */
unsigned char second; /* Seconds */
unsigned char hsecond; /* Hundredths of seconds */
};
struct date
{
int da_year; /* Year - 1980 */
char da_day; /* Day of the month */
char da_mon; /* Month (1 = Jan) */
};
struct dosdate_t
{
unsigned char day; /* 1-31 */
unsigned char month; /* 1-12 */
unsigned int year; /* 1980 - 2099 */
unsigned char dayofweek;/* 0 - 6 (0=Sunday) */
};
#if defined(__FLAT__)
#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct ffblk {
long ff_reserved;
long ff_fsize;
unsigned long ff_attrib;
unsigned short ff_ftime;
unsigned short ff_fdate;
char ff_name[256];
};
struct _wffblk {
long ff_reserved;
long ff_fsize;
unsigned long ff_attrib;
unsigned short ff_ftime;
unsigned short ff_fdate;
wchar_t ff_name[256];
};
#endif /* __FFBLK_DEF */
struct find_t
{
long reserved;
long size; /* size of file */
unsigned long attrib; /* attribute byte for matched file */
unsigned short wr_time; /* time of last write to file */
unsigned short wr_date; /* date of last write to file */
char name[256]; /* asciiz name of matched file */
};
#else /* __FLAT__ */
#ifndef _FFBLK_DEF
#define _FFBLK_DEF
struct ffblk
{
char ff_reserved[21];
char ff_attrib;
unsigned ff_ftime;
unsigned ff_fdate;
long ff_fsize;
char ff_name[13];
};
#endif /* _FFBLK_DEF */
/* The MSC find_t structure corresponds exactly to the ffblk structure */
struct find_t
{
char reserved[21]; /* Microsoft reserved - do not change */
char attrib; /* attribute byte for matched file */
unsigned wr_time; /* time of last write to file */
unsigned wr_date; /* date of last write to file */
long size; /* size of file */
char name[13]; /* asciiz name of matched file */
};
#ifdef __MSC
#define _find_t find_t
#endif
#endif /* !__FLAT__ */
void __emit__(unsigned char __byte, ...);
void _RTLENTRY __int__(int __interruptnum);
unsigned _RTLENTRY _EXPFUNC32 _dos_close(int __fd);
unsigned _RTLENTRY _EXPFUNC32 _dos_creat(const char _FAR *__pathP, unsigned __attr,
int _FAR *__fd);
unsigned _RTLENTRY _EXPFUNC32 _dos_creatnew(const char _FAR *__pathP, unsigned __attr,
int _FAR *__fd);
unsigned _RTLENTRY _EXPFUNC32 _dos_findfirst(const char _FAR *__path,
unsigned __attrib,
struct find_t _FAR *__finfo);
unsigned _RTLENTRY _EXPFUNC32 _dos_findnext(struct find_t _FAR *__finfo);
void _RTLENTRY _EXPFUNC32 _dos_getdate(struct dosdate_t _FAR *__datep);
unsigned _RTLENTRY _EXPFUNC32 _dos_getdiskfree(unsigned __drive,
struct diskfree_t _FAR *__dtable);
void _RTLENTRY _EXPFUNC32 _dos_getdrive(unsigned _FAR *__drive);
unsigned _RTLENTRY _EXPFUNC32 _dos_getfileattr(const char _FAR *__filename,
unsigned _FAR *__attrib);
unsigned _RTLENTRY _EXPFUNC32 _dos_getftime(int __fd, unsigned _FAR *__date,
unsigned _FAR *__time);
void _RTLENTRY _EXPFUNC32 _dos_gettime(struct dostime_t _FAR *__timep);
unsigned _RTLENTRY _EXPFUNC32 _dos_open(const char _FAR *__pathP, unsigned __oflag,
int _FAR *__fd);
unsigned _RTLENTRY _EXPFUNC32 _dos_setdate(struct dosdate_t _FAR *__datep);
void _RTLENTRY _EXPFUNC32 _dos_setdrive(unsigned __drive, unsigned _FAR *__ndrives);
unsigned _RTLENTRY _EXPFUNC32 _dos_setfileattr(const char _FAR *__filename,
unsigned _FAR __attrib);
unsigned _RTLENTRY _EXPFUNC32 _dos_setftime(int __fd, unsigned __date, unsigned __time);
unsigned _RTLENTRY _EXPFUNC32 _dos_settime(struct dostime_t _FAR *__timep);
void _RTLENTRY _EXPFUNC disable(void);
long _RTLENTRY _EXPFUNC dostounix(struct date _FAR *__d, struct time _FAR *__t);
void _RTLENTRY _EXPFUNC enable(void);
void _RTLENTRYF _EXPFUNC32 getdate(struct date _FAR *__datep);
void _RTLENTRY _EXPFUNC32 getdfree(unsigned char __drive,
struct dfree _FAR *__dtable);
int _RTLENTRY _EXPFUNC32 _getdrive(void);
void _RTLENTRYF _EXPFUNC32 gettime(struct time _FAR *__timep);
void _RTLENTRY _EXPFUNC32 setdate(struct date _FAR *__datep);
void _RTLENTRY _EXPFUNC32 settime( struct time _FAR *__timep);
void _RTLENTRY _EXPFUNC unixtodos(long __time, struct date _FAR *__d,
struct time _FAR *__t);
int _RTLENTRYF _EXPFUNC32 unlink(const char _FAR *__path);
#if defined(__FLAT__)
unsigned _RTLENTRY _EXPFUNC _dos_read(int __fd, void *__buf, unsigned __len,
unsigned *__nread);
unsigned _RTLENTRY _EXPFUNC _dos_write(int __fd, const void *__buf, unsigned __len,
unsigned *__nread );
#else
unsigned _RTLENTRY _dos_read(int __fd, void __far *__buf, unsigned __len,
unsigned _FAR *__nread);
unsigned _RTLENTRY _dos_write(int __fd, const void __far *__buf, unsigned __len,
unsigned _FAR *__nread );
#en